//
//  View.swift
//  MoyoungCommon
//
//  Created by 李然 on 2022/7/19.
//

import UIKit
import SnapKit
import MoyoungLib

open class View: UIView {
    
    public override init(frame: CGRect) {
        super.init(frame: frame)
        self.makeUI()
    }
    
    required public init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    open func makeUI() {
        self.layer.masksToBounds = false
        updateUI()
    }

    open func updateUI() {
        setNeedsDisplay()
    }
}

extension UIView {

    public func setPriority(_ priority: UILayoutPriority, for axis: NSLayoutConstraint.Axis) {
        self.setContentHuggingPriority(priority, for: axis)
        self.setContentCompressionResistancePriority(priority, for: axis)
    }
}
